/**
 *     This file is part of cesm-ws.
 *
 *     cesm-ws, Web Service for Community Earth System Model
 *
 *     Copyright (c) 2010, Purdue University and/or affilicates or thrid-party contributors as
 *     indicated by the @author tags or express copyright attribution statements
 *     applied by the authors. All third-party contributions are distributed under
 *     license by Purdue University.
 *
 *     cesm-ws is free software: you can redistribute it and/or modify
 *     it under the terms of the GNU General Public License as published by
 *     the Free Software Foundation, either version 3 of the License, or
 *     (at your option) any later version.
 *
 *     This program is distributed in the hope that it will be useful,
 *     but WITHOUT ANY WARRANTY; without even the implied warranty of
 *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *     GNU General Public License for more details.
 *
 *     You should have received a copy of the GNU Lesser General Public License
 *     along with this distribution.  If not, see <http://www.gnu.org/licenses/>.
 */

package edu.purdue.rcac.service.dispatch;

import edu.purdue.rcac.grid.submit.SubmitterResponse;

public class FileContentResponse extends AbstractResponse {
	private String fileName;
	private String content;

	public FileContentResponse() {
		this.content = "";
		this.fileName = "";
	}

	public FileContentResponse(SubmitterResponse submitterResponse) {
		this();
		switch (submitterResponse.getOutcome()) {
		case SUCCESS:
			this.outcome = Outcome.SUCCESS;
			break;
		case FAIL:
			this.outcome = Outcome.FAIL;
			break;
		case UNKNOWN:
			this.outcome = Outcome.UNKNOWN;
			break;
		}
		this.fileName = submitterResponse.getLog();
		this.content = submitterResponse.getResult();
	}

	public String getFileName() {
		return fileName;
	}

	public void setFileName(String fileName) {
		this.fileName = fileName;
	}

	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}

}
